home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
IBDRS.TAS
< prev
next >
Wrap
Text File
|
1992-04-28
|
3KB
|
71 lines
{The following Script is an attempt to calculate the IBD
RS index per the Note Martin posted in Prodigy. The ADJ lines
can be used to 'tune' the range of each group of RS values
which start with 99. (Example: when you divide the number of
stocks used by 100 and the result is 2.5, do you want to use
3 stocks in the 99 range or 2 ?) Of course to match IBD's RS
values you would need the same group of stocks they use.
Leon Egleson Mandeville, La.
Prodigy CWRB23A }
{TICNAME.TCK}
#MAX_QUOTES 262
#INDEX 'SP-500'
{#OUTPUT_FILE 'IBDRS.LST'}
IF FIRST_TICKER THEN
BEGIN
COUNT22 = 0; {COUNT OF STOCKS TO DIVIDE BY 100}
COUNT66 = 0; {COUNT OF STOCKS USED}
WRITELN(' RS % PRIOR PRIOR RS');
WRITELN('TIC IBD ROC CLOSE CLOSE VOL VOL SP-500');
WRITELN('==== ==== === ====== ====== ==== ===== =====');
END;
IF QUOTE_COUNT < 261 THEN {TO USE ONLY ABOUT A YEAR OF QUOTES}
GOTO AGAIN;
ROC260 : ARRAY; {RATE OF CHANGE LAST 260 DAYS}
YEST : ARRAY;
YESTV : ARRAY;
YEST = C[-1]; {YESTERDAY'S CLOSE}
YESTV = V[-1]; {YESTERDAY'S VOLUME}
BASE := INDEX / INDEX[-260]; {ONE WAY OF CALCULATING RS}
STKBASE := C / C[-260]; { " " " " " }
RELSTR := STKBASE / BASE; { " " " " " }
NUM1 = 0; {COUNTER}
NO1 = 0; {COUNTER}
COUNT44 = 99; {FIRST IBD RS}
ROC260 = ROC(C,260,'%');
IF C = C THEN {JUST A WAY TO ADVANCE THE COUNTER}
COUNT22 = COUNT22 + 1;
IF C = C THEN {JUST A WAY TO ADVANCE THE COUNTER}
COUNT66 = COUNT66 + 1;
SORTOUT(TICKER,ROC260,C,YEST,V,YESTV,RELSTR);
:AGAIN
IF LAST_TICKER THEN
BEGIN
COUNT22 = COUNT22 / 100; {TOTAL STOCKS USED DIVIDED BY 100}
{COUNT22 = INT(COUNT22);} {ADJ LINE}
SORTON(2,'D');
:RS99
SORTGET(TICKER,ROC260,C,YEST,V,YESTV,RELSTR);
IF NO1 >= COUNT22 THEN {ADJ LINE}
GOSUB READD;
WRITELN(TICKER,' ',INT(COUNT44),INT(ROC260),C,YEST,' ',INT(V),' ',INT(YESTV),
RELSTR);
NO1 = NO1 + 1; {COUNTER OF NUMBER ACCUMULATED IN GROUP RS}
NUM1 = NUM1 + 1;
IF NUM1 < COUNT66 THEN {IF NOT LAST STOCK LOOP BACK TO RS99}
GOTO RS99;
ELSE {IF LAST STOCK GO DOWN TO FINAL}
GOTO FINAL;
:READD {ROUTINE IF LAST OF A GROUP OF RS COUNTED}
COUNT44 = COUNT44 - 1; {COUNTER TO CHANGE TO NEXT GROUP OF RS}
NO1 = 0; {RESET COUNTER TO START ADDS OF NEW GROUP OF RS}
WRITELN('---------------------------------------------------------');
RETURN;
:FINAL
WRITELN(' ');
WRITELN('---------------------------------------------------------');
WRITELN('TOTAL COMPANIES USED =',' ',INT(COUNT66));
WRITELN('TEN SEGMENT USED =',COUNT22);
WRITELN(' USE ADJ LINES IN THE SCRIPT TO ADJUST FOR NUMBER OF STOCKS');
WRITELN(' IN YOUR FILES FOR THE TEN SEGMENT CALCULATION');